package lolxxs.chenyanting.controller;


import lolxxs.chenyanting.entity.Result;
import lolxxs.chenyanting.entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

// 全局异常处理
@ControllerAdvice
public class ResumeExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public Result errpr(Exception e) {
        e.printStackTrace();
        return new Result(false, StatusCode.ERROR, e.getMessage());
    }
}
